<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>banner管理</title>
    <%@ include file="../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
    <style>
    </style>
    <script>
        var searchInfo = ${searchInfo};
        var statusMap = ${statusMap};
        var contentType = ${contentType};
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight" id="vue">
    <div class="tabs-container">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-search"></i> 筛选查询</h5>
                    </div>
                    <div class="ibox-content ibox-content-search">
                        <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">标题：</label>
                                <div class="col-sm-2">
                                    <input type="text" name="title" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="title" class="form-control"  placeholder="输入标题名称" maxlength="50"
                                           value="${not empty searchInfo ? searchInfo.title : ''}">
                                </div>
                                <label class="col-sm-1 control-label">一级科室：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="deptCode" id="deptCode" onchange="doRefresh()">
                                    <option value="">--请选择--</option>
                                    <c:forEach items="${deptMap}" var="item">
                                    <option value="${item.deptCode}" ${not empty searchInfo && searchInfo.deptCode == item.deptCode? 'selected' : '' } >${item.deptName}</option>
                                    </c:forEach>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">状态：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="status" id="status" onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:forEach items="${statusMap}" var="item">
                                            <option value="${item.key}" ${not empty searchInfo && searchInfo.status == item.key? 'selected' : '' } >${item.value}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                                <div class="ibox-tools ibox-tools-search">
                                    <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                                    <button type="button" class="btn btn-primary btn-outline" onclick="clearFrom('searchForm')">重置</button>
                                    <%--<button type="button" class="btn btn-primary btn-outline" onclick="openSearchTools();"><i class="fa fa-caret-down"></i></button>--%>
                                </div>
                            </div>
                                <%--<label class="col-sm-1 control-label">关联一级科室：</label>--%>
                                <%--<div class="col-sm-2">--%>
                                    <%--<select class="form-control" name="deptCode" id="deptCode" onchange="doRefresh()">--%>
                                        <%--<option value="">--请选择--</option>--%>
                                        <%--<c:forEach items="${deptMap}" var="item">--%>
                                            <%--<option value="${item.code}" ${not empty searchInfo && searchInfo.deptCode == item.code? 'selected' : '' } >${item.name}</option>--%>
                                        <%--</c:forEach>--%>
                                    <%--</select>--%>
                                <%--</div>--%>
                            <%--</div>--%>
                        <%--</div>--%>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-table"></i> 运营位列表</h5>
                    </div>
                    <div class="ibox-content">
                        <table class='table table-striped table-hover'
                               id="leftTable" data-height="400"
                               data-toggle="table"
                               data-url="${ctx}/operative/banner/pageFindSysData?t=${now}"
                               data-pagination="true"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type=""
                               data-page-size="${defaultPageSize}"
                               data-page-list="${pageList}">
                            <thead>
                            <tr>
                                <th data-field="dictCode" data-visible="false">dictCode</th>
                                <th data-field="dictName" data-align="center" data-formatter="initCheck">banner名称</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
            <div class="col-sm-9" style="padding-left: 0px;">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <div class="ibox-tools col-sm-offset-2">
                            <c:if test="${userType == 'super' || not empty btnMap['addBanner']}">
                                <button class="btn btn-primary btn-outline" onclick="openAddBannerPage()">新增</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['editBanner']}">
                                <button class="btn btn-primary btn-outline" onclick="openEditBannerPage()">编辑</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['delBanner']}">
                                <button class="btn btn-primary btn-outline" onclick="delBanner()">删除</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['commitBanner']}">
                                <button type="button" class="btn btn-primary btn-outline" onclick="pubishBanner()" >发布</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['revokeBanner']}">
                                <button type="button" class="btn btn-primary btn-outline" onclick="unPublishBanner()">撤销</button>
                            </c:if>
                                <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table
                               id="dataTable" data-height="400"
                               data-toggle="table"
                               data-url="${ctx}/operative/banner/pageFindBannerData?t=${now}"
                               data-pagination="true"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type=""
                               data-query-params="getParams"
                               data-page-number="${not empty searchInfo.pageNo ? searchInfo.pageNo : 1}"
                               data-page-size="${not empty searchInfo.pageSize ? searchInfo.pageSize : defaultPageSize}"
                               data-page-list="${pageList}">
                            <thead>
                            <tr>
                                <th data-field="id" data-visible="false">id</th>
                                <th data-field="status" data-formatter="formatStatus" data-align="center" data-width="80px">状态</th>
                                <th data-field="title" data-align="center" data-width="150px">标题</th>
                                <th data-field="shortName" data-align="center" data-width="120px">banner简称</th>
                                <%--<th data-field="city" data-align="center" data-width="120px">城市</th>--%>
                                <th data-field="contentType" data-formatter="formatType" data-align="center" data-width="120px">课程分类</th>
                                <th data-field="bannerType" data-visible="false">bannerType</th>
                                <th data-field="deptName" data-align="center" data-width="120px">对应一级科室</th>
                                <th data-field="sourceName" data-align="center" data-width="120px">对应渠道</th>
                                <th data-field="picUrl" data-formatter="img" data-align="center" data-width="80px">图片</th>
                                <th data-field="sortNum" data-align="center" data-width="90px">排序</th>
                                <%--<th data-field="columnName" data-align="center" data-width="120px">内容</th>--%>
                                <th data-field="startTime" data-formatter="time" data-align="center" data-width="140px">开始生效时间</th>
                                <th data-field="endTime" data-formatter="time" data-align="center" data-width="140px">结束生效时间</th>
                                <th data-field="operator" data-align="center" data-formatter="formatterOperator" data-width="100px">操作人员</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="text-center">${companyName}</div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/operative/bannerManage.js?t=${now}"></script>
</body>
</html>

